Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various performance optimizations #310

Merged
merged 5 commits into from
Jun 22, 2023
Merged

Various performance optimizations #310

merged 5 commits into from
Jun 22, 2023

Conversation

zenangst
Copy link
Owner

Seems odd, but having the built-in toggles in reusable views seems
like a bit of a performance hit in SwiftUI.

So, I ended up recreating the system controls.
Introducing AppCheckbox and AppToggle.

They look like this (the system one is also there for reference):

image image
  • Remove linear gradient commands, it comes with a hefty performance penalty
    to render a gradient layer with blended colors
  • Remove the shadow from the command views
  • Add debouncing when editing application names
  • Add new AppCheckbox & AppToggle
  • Replace all use of Toggle with wither AppCheckbox or AppToggle
  • Fix warnings about using var instead of let
  • Refactor performance data generator in ContentStore

- Remove linear gradient commands, it comes with a hefty performance penalty
  to render a gradient layer with blended colors
- Remove the shadow from the command views
- Add debouncing when editing application names
- Add new `AppCheckbox` & `AppToggle`
- Replace all use of `Toggle` with wither `AppCheckbox` or `AppToggle`
- Fix warnings about using `var` instead of `let`
- Refactor performance data generator in `ContentStore`
@zenangst
Copy link
Owner Author

The cool thing about this is now we have more control over the "system controls".
So we can create variants. We support two right now, which is "regular" and "small".

@zenangst
Copy link
Owner Author

The checkbox differs from the system one because I think that uses two bitmaps as it has gradients, among other things.

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

@zenangst zenangst merged commit 39eeaf4 into main Jun 22, 2023
2 checks passed
@zenangst zenangst deleted the performance/debugging branch June 22, 2023 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant